<template>
	<view class="deviceDetails ff-line-height-1-3">
		<u-table padding="30rpx 20rpx" align="left">
			<u-tr>
				<u-th>设备名称</u-th>
			</u-tr>
			<u-tr v-for="(item, index) of maintenanceDetails" :key="index">
				<u-td>{{ item.deviceName }}</u-td>
			</u-tr>
		</u-table>
		<!-- 组件区 -->
		<f-loading ref="loading" />
	</view>
</template>

<script>
	export default {
		name: 'deviceDetails',
		data() {
			return {
				maintenanceDetails: [] // 设备列表
			};
		},
		onLoad(e) {
			// console.log('前页面传过来的数据------', e);
			this.getMaintenanceDetails(e.id); // 获取检测设备数据
		},
		methods: {
			// 获取检测设备数据
			async getMaintenanceDetails(id) {
				this.$refs.loading.openLoading('加载中···');
				const data = await this.$http.post({
					url: `/bsTestProjectInfo/org/project/device/${id}`
				});
				// console.log('获取检测设备数据------', data);
				if (data.code == 200) {
					this.maintenanceDetails = data.data
				}
				this.$refs.loading.closeLoading();
			}
		},
		onShareAppMessage() {
			return {
				title: '分享小程序给朋友',
				path: '/pages/homePage/Home'
			};
		}
	};
</script>